package com.blog.cmrpersonalblog.exception;

/**
 * 限流异常
 */
public class RateLimitException extends RuntimeException {
    
    /**
     * 剩余时间（秒）
     */
    private Integer remainingTime;
    
    /**
     * 限流次数
     */
    private Integer limitCount;
    
    /**
     * 时间窗口（秒）
     */
    private Integer timeWindow;
    
    public RateLimitException(String message) {
        super(message);
    }
    
    public RateLimitException(String message, Integer remainingTime, Integer limitCount, Integer timeWindow) {
        super(message);
        this.remainingTime = remainingTime;
        this.limitCount = limitCount;
        this.timeWindow = timeWindow;
    }
    
    public Integer getRemainingTime() {
        return remainingTime;
    }
    
    public Integer getLimitCount() {
        return limitCount;
    }
    
    public Integer getTimeWindow() {
        return timeWindow;
    }
}

